<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>专家列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/lib/layui/layui/css/layui.css"/>
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery/jquery.cookie.js"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/js/common/fileupload.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
</head>
<style>
    .mbox {
        padding: 8px
    }

    .item img {
        height: 40px;
    }

    .btn {
        height: 30px;
    }

    .btn button {
        float: right;
    }

    .information {
        background: #e8f4fc;
        height: 30px;
        line-height: 30px;
        margin-bottom: 10px;
    }

    .share {
        width: calc(98% / 2);
        display: inline-block;
    }

    .flex {
        width: calc(96% / 3);
    }

    .layui-form-item {
        margin-bottom: 5px;
    }

    .layui-input-block {
        width: 65%;
    }
    .openFile input[type=file]{
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 18px;
        z-index: 99;
        opacity: 0;
    }
    .layui-table-view i{
        width: 18px;
        height: 18px;
        margin-top: 6px;
    }
</style>
<body>
<div class="mbox">
    <div class="item">
        <img src="../img/yeji.png" alt="" style="margin: 0 5px 0 20px;"> <span
            style="font-size: 22px;display: inline-block;vertical-align: middle;">专家列表</span>
    </div>
    <hr class="layui-bg-blue">
    <div class="btn">
        <button type="button" class="layui-btn layui-btn-sm" style="background: #2b7fe0;"><i
                class="layui-icon layui-icon-upload-drag" style="background: #2b7fe0"></i>导出Excel
        </button>
        <button type="button" class="layui-btn layui-btn-sm" style="margin-right: 10px;background: #2b7fe0;"><i
                class="layui-icon layui-icon-search" style="background: #2b7fe0;"></i>查找
        </button>
        <button type="button" class="layui-btn layui-btn-sm add" style="background: #2b7fe0;"><i
                class="layui-icon layui-icon-addition" style="vertical-align: inherit"></i>新增系统专家
        </button>
    </div>
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>
</body>
</html>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="del">删除</a>
</script>
<script>



    layui.use(['table', 'form', 'laydate', 'upload'], function () {
        var table = layui.table,
            form = layui.form,
            laydate = layui.laydate,
            upload = layui.upload;
        var datas
        form.render()
        var tableInt = table.render({
            elem: '#test'
            , url: '/RpmExpert/findRpmExpert'
            , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            , defaultToolbar: ['']
            ,parseData: function(res){ //res 即为原始返回的数据
                return {
                    "code":0, //解析接口状态
                    "data": res.obj, //解析数据列表，
                    "count": res.totleNum, //解析数据长度
                };
            }
            , title: '用户数据表'
            , cols: [[
                {field: 'name', title: '姓名'}
                , {field: 'phone', title: '移动电话'}
                , {field: 'idNumber', title: '身份证号'}
                , {field: 'birthday', title: '出生日期'}
                , {field: 'unit', title: '单位'}
                , {field: 'deptName', title: '部门'}
                , {field: 'positionTime', title: '定职时间'}
                , {field: 'type', title: '操作', toolbar: '#barDemo'}
            ]]
            , page: true
        });
        //新建
        $('.add').click(function () {
            creat(0)
        });

        /*新建和编辑的方法*/
        function creat(type, expertId) {
            if (type == '0') {
                var title = '新建';
            } else {
                var title = '编辑';
            }

            layer.open({
                type: 1,
                title:title,
                btn: ['确定', '取消'],
                shade: 0.5,
                area: ['100%', '100%'],
                content: '<div style="margin: 10px">\n' +
                    '    <form class="layui-form" action="" id="ajaxforms" lay-filter="ajaxforms">\n' +
                    '        <h3 class="information">【基本信息】</h3>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">专家<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-inline">\n' +
                    '                    <input type="text" class="layui-input layui-disabled required" id="expertUserId" name="expertUserId" placeholder="请输选择专家" disabled >\n' +
                    '                </div>\n' +
                    '                 <div class="layui-form-mid layui-word-aux">  ' +
                    '                       <a href="#" class="choice" style="color: blue;" id="ExChoice">选择</a>\n' +
                    '                       <a href="#" class="empty" style="color: red;" id="ExEmpty">清空</a>' +
                    '                  </div> ' +
                    '            </div>\n' +
                    '            </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">专家类别<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="radio" name="expertType" value="1" title="系统外" checked>\n' +
                    '                    <input type="radio" name="expertType" value="2" title="系统内">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">性别<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="radio" name="sex" value="0" title="男" checked>\n' +
                    '                    <input type="radio" name="sex" value="1" title="女">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">姓名<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input required" disabled>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">移动电话<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="phone" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input required">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">身份证号<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="idNumber" lay-verify="title" autocomplete="off" class="layui-input required">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">出生日期<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="birthday" lay-verify="title" autocomplete="off" id="creatdate" class="layui-input required">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">银行类别<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="bankType" lay-filter="aihao" class="required">\n' +
                    '                        <option value="">请选择</option>\n' +
                    '                        <option value="1">国家开发银行</option>\n' +
                    '                        <option value="2">中国进出口银行</option>\n' +
                    '                        <option value="3">中国农业发展银行</option>\n' +
                    '                        <option value="4">中国银行</option>\n' +
                    '                        <option value="5">中国工商银行</option>\n' +
                    '                        <option value="6">中国建设银行</option>\n' +
                    '                        <option value="7">中国农业银行</option>\n' +
                    '                        <option value="8">中国光大银行</option>\n' +
                    '                        <option value="9">中国民生银行</option>\n' +
                    '                        <option value="10">中信银行</option>\n' +
                    '                        <option value="11">交通银行</option>\n' +
                    '                        <option value="12">华夏银行</option>\n' +
                    '                        <option value="13">招商银行</option>\n' +
                    '                        <option value="14">兴业银行</option>\n' +
                    '                        <option value="15">广发银行</option>\n' +
                    '                        <option value="16">平安银行</option>\n' +
                    '                        <option value="17">上海浦东发展银行</option>\n' +
                    '                        <option value="18">恒丰银行</option>\n' +
                    '                        <option value="19">浙商银行</option>\n' +
                    '                        <option value="20">渤海银行</option>\n' +
                    '                        <option value="21">中国邮政储蓄银行</option>\n' +
                    '                        <option value="22">城市商业银行</option>\n' +
                    '                        <option value="23">北京银行</option>\n' +
                    '                        <option value="24">天津银行</option>\n' +
                    '                        <option value="25">河北银行</option>\n' +
                    '                        <option value="26">沧州银行</option>\n' +
                    '                        <option value="27">唐山市商业银行</option>\n' +
                    '                        <option value="28">承德银行</option>\n' +
                    '                        <option value="29">张家口市商业银行</option>\n' +
                    '                        <option value="30">秦皇岛银行</option>\n' +
                    '                        <option value="31">邢台银行</option>\n' +
                    '                        <option value="32">廊坊银行</option>\n' +
                    '                        <option value="33">保定银行</option>\n' +
                    '                        <option value="34">邯郸银行</option>\n' +
                    '                        <option value="35">衡水银行</option>\n' +
                    '                        <option value="36">晋商银行</option>\n' +
                    '                        <option value="37">大同市商业银行</option>\n' +
                    '                        <option value="38">长治银行</option>\n' +
                    '                        <option value="39">其他</option>\n' +

                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">银行卡号<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="bankCard" lay-verify="title" autocomplete="off" class="layui-input required">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">单位<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="unit" lay-verify="title" autocomplete="off" class="layui-input required">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        <div class="layui-form-item share">\n' +
                    '            <div class="layui-inline" style="margin-top: 10px;">\n' +
                    '                <label class="layui-form-label" style="margin-left: 25px;width: 53px">部门<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-inline" style="width: 170px">\n' +
                    '                    <textarea  id="rescueUser" class="layui-textarea required" disabled style="background-color: #f2f2f2;"></textarea>\n'+
                    '                </div>\n' +

                    '            </div>\n' +
                    '        </div>\n' +
                    '        </div>\n' +

                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">职称<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="jobTitle" lay-filter="aihao" class="required">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">一级教师</option>\n' +
                    '<option value="2">幼儿园一级教师</option>\n' +
                    '<option value="3">小学一级教师</option>\n' +
                    '<option value="4">中学一级教师</option>\n' +
                    '<option value="5">二级教师</option>\n' +
                    '<option value="6">幼儿园二级教师</option>\n' +
                    '<option value="7">小学二级教师</option>\n' +
                    '<option value="8">中学二级教师</option>\n' +
                    '<option value="9">三级教师</option>\n' +
                    '<option value="10">幼儿园三级教师</option>\n' +
                    '<option value="11">小学三级教师</option>\n' +
                    '<option value="12">中学三级教师</option>\n' +
                    '<option value="13">高级教师</option>\n' +
                    '<option value="14">幼儿园高级教师</option>\n' +
                    '<option value="15">小学高级教师</option>\n' +
                    '<option value="16">中学高级教师</option>\n' +
                    '<option value="17">讲师</option>\n' +
                    '<option value="18">高级讲师</option>\n' +
                    '<option value="19">助理讲师</option>\n' +
                    '<option value="20">副教授</option>\n' +
                    '<option value="21">管理员</option>\n' +
                    '<option value="22">会计师</option>\n' +
                    '<option value="23">会计员</option>\n' +
                    '<option value="24">助理会计师</option>\n' +
                    '<option value="25">主治医师</option>\n' +
                    '<option value="26">护士</option>\n' +
                    '<option value="27">主管护师</option>\n' +
                    '<option value="28">医师</option>\n' +
                    '<option value="29">护师</option>\n' +
                    '<option value="30">实验师</option>\n' +
                    '<option value="31">实验员</option>\n' +
                    '<option value="32">馆员</option>\n' +
                    '<option value="33">助理馆员</option>\n' +
                    '<option value="34">未评定专业技术职务的其他人员</option>\n' +
                    '<option value="35">其它</option>\n' +
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">定职时间<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="positionTime" lay-verify="title" autocomplete="off" class="layui-input required" id="dingzhi">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">职级<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="rank" lay-filter="aihao" class="required">\n' +
                    '                         <option value="">请选择</option>\n' +
                    '                         <option value="1">中学高级</option>\n' +
                    '                         <option value="2">中级</option>\n' +
                    '                         <option value="3">初级</option>\n' +
                    '                             <option value="4">其他</option>\n'+
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">排序<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="sortOn" lay-verify="title" autocomplete="off" class="layui-input required">\n' +
                    '                </div>\n' +
                    '                <span style="color: red;margin-top: -30px;float: right;margin-right: 5px;">(数字越大排序越靠前)</span>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    ' <div class="layui-form-item"  style="margin-top:15px">\n' +
                    '    <label class="layui-form-label" style="width: 100px;margin-left:-20px">职称证书</label>\n' +
                    '    <div class="layui-input-inline">\n' +
                    '<div id="fujians"></div>' +
                    ' <div id="fileAll">\n' +
                    '</div>\n' +
                    '<a href="javascript:;" class="openFile" style="float: left;margin-top:8px;position:relative">\n' +
                    '<img src="../img/mg11.png" alt="">\n' +
                    '<span>添加附件</span>\n' +
                    '<input type="file" multiple id="fileupload" data-url="/upload?module=RpmExpert" name="file">\n' +
                    '</a>\n' +
                    '</div>\n' +
                    '</div>' +
                    '        <h3 class="information">【学术信息】</h3>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">学位<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="academicDegree" lay-filter="aihao" class="required">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">博士后</option>\n' +
                    '<option value="2">博士</option>\n' +
                    '<option value="3">硕士</option>\n' +
                    '<option value="4">学士</option>\n' +
                    '<option value="5">其他</option>\n'+
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">学历</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="education" lay-filter="aihao">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">硕士以上</option>\n' +
                    '<option value="2">本科</option>\n' +
                    '<option value="3">专科</option>\n' +
                    '<option value="4">专科以下</option>\n'+
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">学科方向</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="direction" lay-filter="aihao">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">学前教育</option>\n' +
                    '<option value="2">幼教</option>\n' +
                    '<option value="3">语文</option>\n' +
                    '<option value="4">数学</option>\n' +
                    '<option value="5">英语</option>\n' +
                    '<option value="6">物理</option>\n' +
                    '<option value="7">化学</option>\n' +
                    '<option value="8">生物</option>\n' +
                    '<option value="9">科学</option>\n' +
                    '<option value="10">信息技术</option>\n' +
                    '<option value="11">劳技</option>\n' +
                    '<option value="12">政治</option>\n' +
                    '<option value="13">历史</option>\n' +
                    '<option value="14">地理</option>\n' +
                    '<option value="15">音乐</option>\n' +
                    '<option value="16">美术</option>\n' +
                    '<option value="17">体育</option>\n' +
                    '<option value="18">教育管理</option>\n' +
                    '<option value="19">德育</option>\n' +
                    '<option value="20">心理</option>\n' +
                    '<option value="21">生命科学</option>\n' +
                    '<option value="22">品德与社会</option>\n' +
                    '<option value="23">自然</option>\n' +
                    '<option value="24">卫生</option>\n' +
                    '<option value="25">拓展型课程</option>\n' +
                    '<option value="26">研究型课程</option>\n' +
                    '<option value="27">探究</option>\n' +
                    '<option value="28">职业教育</option>\n' +
                    '<option value="29">特殊教育</option>\n' +
                    '<option value="30">校外教育</option>\n' +
                    '<option value="31">社区教育</option>\n' +
                    '<option value="32">其他</option>\n'+
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label" style="width: 85px;margin-left: -5px;">第二学科方向</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="direction2" lay-filter="aihao">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">学前教育</option>\n' +
                    '<option value="2">幼教</option>\n' +
                    '<option value="3">语文</option>\n' +
                    '<option value="4">数学</option>\n' +
                    '<option value="5">英语</option>\n' +
                    '<option value="6">物理</option>\n' +
                    '<option value="7">化学</option>\n' +
                    '<option value="8">生物</option>\n' +
                    '<option value="9">科学</option>\n' +
                    '<option value="10">信息技术</option>\n' +
                    '<option value="11">劳技</option>\n' +
                    '<option value="12">政治</option>\n' +
                    '<option value="13">历史</option>\n' +
                    '<option value="14">地理</option>\n' +
                    '<option value="15">音乐</option>\n' +
                    '<option value="16">美术</option>\n' +
                    '<option value="17">体育</option>\n' +
                    '<option value="18">教育管理</option>\n' +
                    '<option value="19">德育</option>\n' +
                    '<option value="20">心理</option>\n' +
                    '<option value="21">生命科学</option>\n' +
                    '<option value="22">品德与社会</option>\n' +
                    '<option value="23">自然</option>\n' +
                    '<option value="24">卫生</option>\n' +
                    '<option value="25">拓展型课程</option>\n' +
                    '<option value="26">研究型课程</option>\n' +
                    '<option value="27">探究</option>\n' +
                    '<option value="28">职业教育</option>\n' +
                    '<option value="29">特殊教育</option>\n' +
                    '<option value="30">校外教育</option>\n' +
                    '<option value="31">社区教育</option>\n' +
                    '<option value="32">其他</option>\n'+
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <h3 class="information">【其他信息】</h3>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">国籍<span style="color: red">*</span></label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="nationality" lay-verify="title" autocomplete="off" class="layui-input required">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">民族</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="nation" lay-filter="aihao">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">汉族</option>\n' +
                    '<option value="2">蒙古族</option>\n' +
                    '<option value="3">土家族</option>\n' +
                    '<option value="4">藏族</option>\n' +
                    '<option value="5">瑶族</option>\n' +
                    '<option value="6">彝族</option>\n' +
                    '<option value="7">朝鲜族</option>\n' +
                    '<option value="8">满族</option>\n' +
                    '<option value="9">侗族</option>\n' +
                    '<option value="10">壮族</option>\n' +
                    '<option value="11">苗族</option>\n' +
                    '<option value="12">哈萨克族</option>\n' +
                    '<option value="13">锡伯族</option>\n' +
                    '<option value="14">回族</option>\n'+
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">所在地区</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <select name="area" lay-filter="aihao">\n' +
                    '                        <option value="">请选择</option>\n' +
                    '                        <option value="1">省内</option>\n' +
                    '                        <option value="2">省外</option>\n' +
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">政治面貌</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="political" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">联系地址</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="address" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">邮编</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="postcode" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">办公电话</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="telNoDept" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">办公传真</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="faxNoDept" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">电子邮件</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="email" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">家庭电话</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="telNoHome" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">家庭传真</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="faxNoHome" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-inline flex">\n' +
                    '                <label class="layui-form-label">外语</label>\n' +
                    '                <div class="layui-input-inline">\n' +
                    '                    <select name="fl1">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">英语</option>\n' +
                    '<option value="2">德语</option>\n' +
                    '<option value="3">日语</option>\n' +
                    '<option value="4">韩语</option>\n' +
                    '<option value="5">法语</option>\n' +
                    '<option value="6">俄语</option>\n' +
                    '<option value="10">汉语</option>\n' +
                    '<option value="11">其他语种</option>\n' +
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-inline flex">\n' +
                    '                <label class="layui-form-label" style="width:50px">熟练度</label>\n' +
                    '                <div class="layui-input-inline">\n' +
                    '                    <select name="proficiency1" lay-verify="required" lay-search="">\n' +
                    '                        <option value="">请选择</option>\n' +
                    '                        <option value="1">熟练</option>\n' +
                    '                        <option value="2">一般</option>\n' +
                    '                    </select>\n' +
                    '                </div>\n' +
                    '                <div class="layui-input-inline">\n' +
                    '                    <select name="fl2" lay-verify="required" lay-search="">\n' +
                    '<option value="">请选择</option>\n' +
                    '<option value="1">英语</option>\n' +
                    '<option value="2">德语</option>\n' +
                    '<option value="3">日语</option>\n' +
                    '<option value="4">韩语</option>\n' +
                    '<option value="5">法语</option>\n' +
                    '<option value="6">俄语</option>\n' +
                    '<option value="10">汉语</option>\n' +
                    '<option value="11">其他语种</option>\n' +
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '            <div class="layui-inline flex">\n' +
                    '                <label class="layui-form-label">熟练度</label>\n' +
                    '                <div class="layui-input-inline">\n' +
                    '                    <select name="proficiency2" lay-verify="required" lay-search="">\n' +
                    '                        <option value="">请选择</option>\n' +
                    '                        <option value="1">熟练</option>\n' +
                    '                        <option value="2">一般</option>\n' +
                    '                    </select>\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item">\n' +
                    '            <div class="layui-form-item share">\n' +
                    '                <label class="layui-form-label">个人网站</label>\n' +
                    '                <div class="layui-input-block">\n' +
                    '                    <input type="text" name="personalWebsite" lay-verify="title" autocomplete="off" class="layui-input">\n' +
                    '                </div>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '        <div class="layui-form-item layui-form-text">\n' +
                    '            <label class="layui-form-label">特长</label>\n' +
                    '            <div class="layui-input-block">\n' +
                    '                <textarea class="layui-textarea specialty" name="specialty"></textarea>\n' +
                    '            </div>\n' +
                    '        </div>\n' +
                    '    </form>\n' +
                    '</div>',
                success: function (res) {
                    laydate.render({
                        elem: '#creatdate'
                        ,trigger: 'click'//呼出事件改成click
                        ,type:'datetime'
                        ,format: 'yyyy-MM-dd HH:mm:ss'
                    });
                    laydate.render({
                        elem: '#dingzhi'
                        ,trigger: 'click'//呼出事件改成click
                        ,type:'datetime'
                        ,format: 'yyyy-MM-dd HH:mm:ss'
                    });

                    //选择专家
                    $(document).on("click","#ExChoice",function(){
                        user_id="expertUserId";
                        $.popWindow("../common/selectUser?0");
                    });

                    //清空专家
                    $(document).on("click","#ExEmpty",function(){
                        $('#expertUserId').attr("user_id", "");
                        $('#expertUserId').attr("username", "");
                        $('#expertUserId').attr("dataid", "");
                        $('#expertUserId').attr("userprivname", "");
                        $('#expertUserId').val("");
                    });



                    fileuploadFn('#fileupload', $('#fileAll'));
                    form.render()
                    if(type==1){
                        $.ajax({
                            url:'/RpmExpert/findRpmExpert',
                            dataType: 'json',
                            type: 'get',
                            data:{
                                expertId:expertId
                            },
                            success:function (res) {

                                //部门
                                $('#rescueUser').val(res.obj[0].deptName)
                                $("#rescueUser").attr('deptId',res.obj[0].deptId);

                                //附件
                                var str = ''
                                if(res.obj[0].attachmentList &&res.obj[0].attachmentList.length>0){
                                    for(var i=0;i<res.obj[0].attachmentList.length;i++){
                                        str+='<div class="dech" deUrl="' +res.obj[0].attachmentList[i].attUrl + '"><a href="/download?' + res.obj[0].attachmentList[i].attUrl + '" NAME="' + res.obj[0].attachmentList[i].attachName +'*"><img style="margin-right:10px;" src="/img/attachment_icon.png"/>' + res.obj[0].attachmentList[i].attachName + '</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="/img/file/icon_deletecha_03.png"/><input type="hidden" class="inHidden" value="' + res.obj[0].attachmentList[i].aid + '@' + res.obj[0].attachmentList[i].ym + '_' + res.obj[0].attachmentList[i].attachId +',"></div>'
                                    }
                                }
                                $('#fujians').html(str);

                                // 专家
                                if (res.obj[0].users){
                                    $('#expertUserId').val( res.obj[0].users.userName );
                                    $('#expertUserId').attr("user_id", res.obj[0].users.userId);
                                }

                                form.val("ajaxforms", res.obj[0]);
                            }

                        })
                    }
                },
                yes:function (index) {

                    for (var i = 0; i < $('.required').length; i++) {
                        if ($('.required').eq(i).val() == '') {
                            var content=$('.required').eq(i).parents('.layui-inline').children('.layui-form-label').text()
                            if(content==''){
                                var content=$('.required').eq(i).parents('.layui-form-item').children('.layui-form-label').text()
                            }
                            $.layerMsg({
                                content: '' + content.substr(0,content.length-1) + '不能为空',
                                icon: 2
                            });
                            return false;
                        }
                    }

                    //专家
                    var userId = $('#expertUserId').attr('user_id');
                    userId = userId.substring(0,userId.length-1);
                    //判断专家是否为空
                    if(userId == ''){
                        layer.msg('专家为必填项');
                        return false;
                    }


                    //附件
                    var attachmentId = '';
                    var attachmentName = '';
                    for (var i = 0; i < $('#fileAll .dech').length; i++) {
                        attachmentId += $('#fileAll .dech').eq(i).find('input').val();
                        attachmentName += $('#fileAll a').eq(i).attr('name');
                    }

                    var data = $('#ajaxforms').serialize();
                        data+='&attachmentId=' + attachmentId;
                        data+='&attachmentName=' + attachmentName;
                        data+='&deptId=' + $('#rescueUser').attr('deptid');
                        data+='&userId=' + userId;
                        data+='&name=' + $('input[name="name"]').val();


                    if(type == 0){
                        var url = '/RpmExpert/insertRpmExpert'
                    }else{
                        var url='/RpmExpert/editRpmExpert?expertId='+expertId
                    }



                    $.ajax({
                        url: url,
                        dataType: 'json',
                        type: 'post',
                        data: data,
                        success: function (res) {
                            if (res.flag) {
                                layer.msg('新增成功！', {icon: 1});
                                tableInt.reload()
                                layer.closeAll();
                            }
                        }
                    })
                }
            })
        }

        //监听行工具事件
        table.on('tool(test)', function (obj) {
            datas = obj.data;
            var expertId = datas.expertId
            if (obj.event === 'edit') {
                creat(1,expertId)
            }else if(obj.event === 'del') {
                layer.confirm('真的删除当前数据吗？', function (index) {
                    $.ajax({
                        type: 'get',
                        url: '/RpmExpert/delRpmExpert?expertId='+expertId,
                        dataType: 'json',
                        success: function (res) {
                            if (res.msg == 'ok') {
                                layer.msg('删除成功！', {icon: 1});
                                tableInt.reload()
                                layer.closeAll();
                            }
                        }
                    })
                });
            }
        });

        //删除附件
        $(document).on('click', '.deImgs', function () {
            var _this = this;
            var attUrl = $(this).parents('.dech').attr('deUrl');
            layer.confirm('确定删除该附件吗？', function (index) {
                $.ajax({
                    type: 'get',
                    url: '/delete?' + attUrl,
                    dataType: 'json',
                    success: function (res) {

                        if (res.flag == true) {
                            layer.msg('删除成功', {icon: 6, time: 1000});
                            $(_this).parent().remove();
                        } else {
                            layer.msg('删除失败', {icon: 2, time: 1000});
                        }
                    }
                })
            });
        });

    });
    function checkOver(userid){
       $.ajax({
           url:'/user/findUserByuserId',
           dataType: 'json',
           type: 'get',
           data:{
               userId:userid.substr(0,userid.length-1)
           },
           success:function (res) {
               $('input[name="name"]').val(res.object.userName);
               $('input[name="phone"]').val(res.object.mobilNo);
               if(res.object.sex==0){
                   $('input[name=sex][value="0"]').next().click()
               }else{
                   $('input[name=sex][value="1"]').next().click()
               }
               $('input[name="idNumber"]').val(res.object.idNumber)
               $('input[name="birthday"]').val(res.object.birthday)

               $('#rescueUser').val(res.object.deptName);
               $('#rescueUser').attr('deptid', res.object.deptId);
           }
       })
    }
</script>
